This invention relates to an image processing method, apparatus and storage medium for generating a mosaic image by combining a plurality of material images into a mosaic pattern.
According to Sanseido""s xe2x80x9cDictionary of the Modern Japanese Languagexe2x80x9d, a mosaic is a xe2x80x9cdesign or method in which small pieces of stone, glass or marble etc. of various colors are combined and imbedded in a floor or wall.xe2x80x9d By using this technique, a number of photographic images can be combined to form a design or a single image (i.e., a mosaic image). The generation of a mosaic image is achieved by splitting the basic plan or image into a plurality of tiles and pasting material images that most closely resemble these tile images to the tile areas.
When such a mosaic image is created, the original image of interest is divided up into a plurality of areas (tile areas), material images (tile images) which will constitute the mosaic image are selected from a plurality of material images and the selected material image are affixed to respective ones of the tile areas to create the mosaic image. When this is done, the joints between adjacent tile areas become discontinuous, resulting in a mosaic image of poor quality.
A material image of the kind mentioned above is selected by comparing the image feature quantity of a tile area, which has been obtained by splitting up the original image of interest, and the image feature quantities of the available material images. When the feature quantity of a material image is calculated, there are cases where an image area such as a black border surrounds each material image, depending upon the database which stores the plurality of material images. Such a black border is an unnecessary image area when a mosaic image is formed and, as a consequence, gives rise to certain problems.
Specifically, when, in calculating the feature quality of a material image, the average density within the material image, for example, is calculated taking the black border into account, the calculated value is influenced by the black border and differs from the feature quantity of the original material image.
Further, in a case where the image of each tile area obtained by dividing up the original image is compared with each material image and a material image suited to a tile area is selected, here too the black border has an influence. As a consequence, material images close to the features of the images of the tile areas will no longer be selected.
The above-cited problems arise not only when a mosaic image is formed but also when the feature quantity of each material image is calculated in a search of similar images for the purpose of selecting a material image similar to an image of interest.
Further, when material images which include the above-mentioned black borders are used as is to form a mosaic image, the mosaic image formed develops a grid-shaped pattern ascribable to the black borders. Such a mosaic image is of poor quality.
Accordingly, an object of the present invention is to provide an image processing method, apparatus and storage medium in which filtering processing is applied to a mosaic image to mitigate the discontinuity of the tile areas and thereby improve the quality of the mosaic image.
Another object of the present invention is to provide an image processing method, apparatus and storage medium in which filtering processing is applied to the pixels at the joints of adjacent areas in a mosaic image to thereby make the joints unnoticeable and form a high-quality mosaic image.
A further object of the present invention is to provide an image processing method, apparatus and storage medium in which a predetermined area is removed from material images and, in dependence upon the feature quantities of these material images from which the predetermined area has been removed and the feature quantities of the areas constituting an image of interest, a material image conforming to each of these areas is selected from the plurality of material images, thereby preventing deterioration of the mosaic image caused by the image of the predetermined area originally contained in each material image.
According to the present invention, the foregoing objects are attained by providing an image processing apparatus for forming a mosaic image by combining a plurality of material images, comprising: dividing means for dividing an image, which is the basis of the mosaic image, into a plurality of areas; image characteristic acquisition means for obtaining an image characteristic of each area obtained by division by the dividing means; mosaic image forming means for selecting material images, which corresponds to respective ones of the areas, in dependence upon distances between the image characteristic of each area and the image characteristics of respective ones of the plurality of material images, and pasting the selected material images together to thereby form a mosaic image; and filtering means for applying filtering processing to the mosaic image formed by the mosaic image forming means.
Further, according to the present invention, the foregoing objects are attained by providing an image processing method for forming a mosaic image by combining a plurality of material images, comprising the steps of dividing an image, which is the basis of the mosaic image, into a plurality of areas; forming a mosaic image by selecting and pasting together material images conforming to respective ones of the areas obtained by division; and applying filtering processing to the mosaic image.
Further, according to the present invention, the foregoing objects are attained by providing an image processing method for forming a mosaic image by combining a plurality of material images, comprising: a dividing step of dividing an image, which is the basis of the mosaic image, into a plurality of areas; a removal step of removing an image of a predetermined area contained in each of the material images; a selection step of comparing each area obtained by division at the dividing step with the material images from which the predetermined area has been removed at the removal step, and selecting a material image that corresponds to each area; and a forming step of forming a mosaic image by pasting, to these areas, the material images, which have been selected at the selection step, from which the predetermined area has been removed at the removal step.
Further, according to the present invention, the foregoing objects are attained by providing an image processing apparatus for forming a mosaic image by combining a plurality of material images, comprising: dividing means for dividing an image, which is the basis of the mosaic image, into a plurality of areas; removal means for removing an image of a predetermined area contained in each of the material images; selection means for comparing each area obtained by division by the dividing means with the material images from which the predetermined area has been removed by the removal means, and selecting a material image that corresponds to each area; and forming means for forming a mosaic image by pasting, to the areas, the material images, which has been selected at the selection step, from which the predetermined area has been removed at the removal step.
The filtering processing is processing for applying a low-pass filter to each pixel of the mosaic image.
Further, the low-pass filter is an edge softening filter.
Further, the filtering processing is processing for applying a low-pass filter to each pixel of a boundary portion of each area of the mosaic image.
Further, the low-pass filter is a filter for averaging the density of pixels bracketing the boundary portion.
The above-mentioned predetermined area is a border area of the material image.
Further, the selection means includes calculation means for obtaining an image characteristic of each area obtained by division by the dividing means, and calculating distances between the image characteristics of each of the areas and image characteristics of respective ones of the material images from which the image of the predetermined area has been removed by the removal means, wherein the selection means selects material images corresponding to each of the areas in dependence upon result of calculation performed by the calculation means.
Further, the above-mentioned distance is decided based upon the difference between average values of respective ones of R, G, B components of each area and average values of respective ones of R, G, B components of each material image.
Other features and advantages of the present invention will be apparent from the following description taken in conjunction with the accompanying drawings, in which like reference characters designate the same or similar parts throughout the figures thereof.